package com.webproject.shop.service.impl;

import com.webproject.shop.dao.HistoryMapper;
import com.webproject.shop.service.HistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.webproject.shop.pojo.History;

import java.util.List;

@Service
public class HistoryServiceImpl implements HistoryService {

    @Autowired
    private HistoryMapper historyMapper;

    @Override
    public List<History> selectHistoryByUsername(String username){
        List<History> histories = historyMapper.selectByUsername(username);
        return histories;
    }

    @Override
    public void deleteHistory(History history){
        historyMapper.deleteHistory(history);
    }

    @Override
    public void insertHistory(History history){
        historyMapper.insert(history);
    }

}
